import math
x,s=1,0
k=1
sign=-1
while math.fabs(x)>1e-8:
    s+=x
    k+=2
    sign*=-1
    x=sign/k
s*=4
print('pi={:.15f}'.format(s))
